﻿CREATE proc [dbo].[proc_CheckInOut_GetEmployeeList]
(
	@UserName nvarchar(50),
	@SearchTxt nvarchar(100)
)
as
	Select 
		Id,
		CompanyId,
		CustomerId,
		(select CustomerName from Customer where CheckInOut.CustomerId = Customer.CustomerId) as Customer,
		ContactPerson,
		ContactTel, 
		Address,
		MainProjectId,
		(Select Title From OProject Where Id=CheckInOut.MainProjectId) As MainProject,
		Content,
		UserName,
		CheckOutTime,
		ISNULL(CheckInTime,'')AS CheckInTime	
	From CheckInOut
	where  UserName=@UserName
	and (select CustomerName from Customer where CheckInOut.CustomerId = Customer.CustomerId) like '%'+@SearchTxt+'%'


